
<?php include './application/views/top.php'; ?>
<script src="/static/js/gsdai.js"></script>
<script src="/static/js/ajaxfileupload.js"></script>
<script src="/static/js/My97DatePicker/WdatePicker.js"></script>
<script src="/static/js/formCheck.js"></script>

<div class="clear"></div>
<div class="user_bottom all"></div>
<div class="clear h50"></div>
<div class="layout uc">
	<?php include './application/views/user/left.php'; ?>
	<div class="right">
		<div class="menu_list"><?php include './application/views/user/menu.php'; ?></div>
        <div class="clear h30"></div>
        <div class="tishi">必须是本人 真实 有效的相关资料！（格式:jpg|png 最大:512K  最高:3000px  最宽:2048px）</div>
        <iframe name="iframe" id="iframe" style="display:none;"></iframe>
        <div class="cont">
        <form id="upload_form"  action="/credentials/doupload"  enctype="multipart/form-data" method="post" target="iframe">
			<dl class="line">
            	<dt>上传资料：</dt>
                <dd><input type="file" name="litpic" class="pubinput" ></dd>
			</dl>
			<dl class="line">
            	<dt>资料类型：</dt>
                <dd>
					<select name="type_id"  class="pubinput">
					<?php foreach($type_list as $key => $val){?>
					<option value="<?php echo $key;?>"><?php echo $val;?></option>
					<?php }?>
					</select>
                </dd>
			</dl>
			<dl class="line">
            	<dt>备注说明：</dt>
                <dd><textarea id="name" name="name"  class="pubinput" style="width: 400px;height: 150px;"></textarea></dd>
			</dl>
            <div class="cb"><input class="button" type="submit" value="确认提交" /></div>
			</form>
        </div>
	</div>
</div>
<div class="clear h50"></div>
<?php include "./application/views/footer.php";?>
<script type="text/javascript">
function form_submit(){
	var options = {
		url : '/credentials/doupload',
		clearForm :true,
		resetForm :true,
		beforeSubmit:  checkForm,
		dataType: "json",
		type:"post",
		contentType:"multipart/form-data",
		success : function(ret) {
			if(ret.msg==''){
				$('#dialog').dialog({
					modal:true,
					title:'系统提示',
					buttons:{"确定":function(){$(this).dialog("close");}},
					close: function() {
						$("#upload_form").resetForm();
						//window.location.reload();
					}
				}); 
				$("#msg").html("上传成功");
			}else{
				$('#dialog').dialog({
					modal:true,
					title:'系统提示',
					buttons:{"确定":function(){$(this).dialog("close");}},
					close: function() {
						//document.getElementById("imgCode").src = "/yanzheng/index/?" + Math.random();//刷新验证码
						$("#upload_form").resetForm();
						window.location.reload();
					}
				}); 
				$("#msg").html(ret.msg);
			}
			
		}
	};
	$("#upload_form").ajaxSubmit(options);
	return false;
}

function checkForm(){
	return true;
}
</script>